/**
 * 事件基类
 * @author zzhanglin 
 * @param type 事件类型
 * @param bubbles 是否冒泡
 */
Event = function(type,bubbles)
{
	this.className="Event";
	this._type = type ; //事件类型
	this._bubbles = bubbles?bubbles:false ;
	
	this._target ; //抛出事件的对象
	this._currentTarget; //事件的当前对象
	this._isDefaultPrevented = false ; //是否阻止默认的事件侦听回调方法
	this._isStopPropagation = false;//是否阻止子节点执行此事件
	this._isImmediatePropagation = false ; 
} ;

//=============================
//=======getter/setter=================
Event.prototype.getType = function(){ return this._type ;} ;
Event.prototype.getBubbles= function(){ return this._bubbles ;};
Event.prototype.getTarget= function(){ return this._target ; };
Event.prototype.getCurrentTarget= function(){ return this._currentTarget ; };
Event.prototype.getIsDefaultPrevented= function(){return this._isDefaultPrevented ;};
Event.prototype.getIsStopPropagation= function(){ return this._isStopPropagation;};
Event.prototype.getIsImmediatePropagation= function(){ return this._isImmediatePropagation ; };

//============方法===========================
Event.prototype.toString = function()
{
	return "type:"+this._type + " target:"+this._target + " currentTarget:"+this._currentTarget+" bubbles:"+this._bubbles  ;
};
Event.prototype.stopPropagation = function(){
	this._isStopPropagation = true ;	
};
Event.prototype.stopImmediatePropagation = function(){
	this._isImmediatePropagation = true ;	
};
Event.prototype.preventDefault = function(){
	this._isDefaultPrevented = false ;	
};
/**
 * 普通复制
 * @returns {Event}
 */
Event.prototype.clone = function(){
	return new Event(this._type , this._bubbles ) ;
};
//基本的一些事件常量
Event.COMPLETE ="complete";
Event.ENTER_FRAME ="enterFrame";
Event.EXIT_FRAME ="exitFrame";
Event.INIT ="init";
Event.CHANGE ="change";
Event.ADDED_TO_STAGE ="addedToStage";
Event.REMOVED_FROM_STAGE ="removedFromStage";
Event.OPEN ="open";
Event.CLOSE = "close";